import random

from DefaultCard import *
from DefaultSet import *
from BaseSet import *
from Player import *
from Pile import *

class Table():
	def __init__(self):
		self.Trash = deque()
		self.MoneySet = [Copper, Silver, Gold]
		self.VictorySet = [ Estate, Duchy, Province, Curse]
		self.BaseSet = [Library, Market, Militia, Mine, Moneylender, Remodel, Smithy, Spy, ThroneRoom, Village, Witch, Woodcutter, Adventurer, Bureaucrat, Cellar, Cancelor, CouncilRoom, Feast, Festival, Gardens, Moat, Chapel, Laboratory, Thief, Workshop ]
		self.AllSets = []
		self.AllSets += self.BaseSet
		self.Decks = []

		self.MoneyPile = [Pile(Copper,100), Pile(Silver,100), Pile(Gold,100)]
		self.VictoryPile = [Pile(Estate,30), Pile(Duchy,20), Pile(Province,12), Pile(Curse,30)]
		self.CardPile = []

	def randomize(self):
		random.shuffle(self.AllSets)
		for i in range(10):
			ceva = self.AllSets[i]
			self.CardPile.append( Pile(ceva,12) )

        def __str__(self):
                # TODO: format better
                string = ""
                for pile in self.MoneyPile:
                        string+= str(pile) + ", "
                string += "\n"
                for pile in self.VictoryPile:
                        string+= str(pile) + ", "
                string += "\n"
                for pile in self.CardPile:
                        string += str(pile) +", "
                return string
